/**
 * RegisterResource.java
 * Jan 6, 2010
 */
package com.dlplay.flightinfo.server.resource;

import org.restlet.representation.Representation;
import org.restlet.representation.StringRepresentation;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;

import com.dlplay.flightinfo.core.FlightSystem;
import com.dlplay.flightinfo.data.AirFlightCode;
import com.dlplay.flightinfo.data.AirlineCode;

/**
 * @author zhao yu
 *
 */
public class RegisterResource extends ServerResource {
	@Get
	 public Representation register() {
		String flightNum = (String) getRequestAttributes().get("flightNum");
		String content = (String) getRequestAttributes().get("content");
		getLogger().info("flight: "+flightNum+" content: "+content);
		FlightSystem.getFlightManager().registerEmail("test", new AirFlightCode(AirlineCode.CA, 1368), content);
		return new StringRepresentation("Register"+flightNum);		
	}
}
